package com.wll.design.core.utils;

/**
 * @ClassName: MyStringutils.java
 * @author: wanglulu
 * @version: 1.0.0
 * @Description: TODO
 * @createTime: 2021/11/24 18:03
 */
public class MyStringutils {

    /**
     * 首字母转小写
     * @param s
     * @return
     */
    public static String toLowerCaseFirstOne(String s) {
        if (Character.isLowerCase(s.charAt(0)))
            return s;
        else
            return (new StringBuilder()).append(Character.toLowerCase(s.charAt(0))).append(s.substring(1)).toString();
    }


    /**
     * 首字母转大写
     * @param s
     * @return
     */
    public static String toUpperCaseFirstOne(String s) {
        if (Character.isUpperCase(s.charAt(0)))
            return s;
        else
            return (new StringBuilder()).append(Character.toUpperCase(s.charAt(0))).append(s.substring(1)).toString();
    }

    public static void main(String[] args) {
        String ddd = toLowerCaseFirstOne("DDD");
        System.out.println(ddd);
    }
}
